"""
文件读写 之 写
"""
from pathlib import Path

with open("data.txt","w",encoding="UTF-8") as file:
    file.write("您好，Python")
    file.write("你好，大爷")
    # 必须是字符串 must be str, not int
    # file.write(18)

with open("data.txt","r",encoding="UTF-8") as file:
   print(file.read())